//
//  ViewController.swift
//  SwiftTool
//
//  Created by 红沙尘 on 2018/11/4.
//  Copyright © 2018年 红沙尘. All rights reserved.
//

import UIKit

class ViewController: UIViewController {
    
    @IBOutlet weak var btn: UIButton!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
   
        btn.process()
        
//    let strg = "【精选预测】广州恒大争三分，上海申花冲击三连胜"
//    let ranStr = "【精选预测】"
//
//    //所有文字变为富文本
//    let attrstring:NSMutableAttributedString = NSMutableAttributedString(string:strg)
//
//    //颜色处理的范围
//    let str = NSString(string: strg)
//    let theRange = str.range(of: ranStr)
//
//    //颜色处理
//    attrstring.addAttribute(NSAttributedStringKey.foregroundColor, value:UIColor.red, range: theRange)
//
//     //行间距
//    let paragraphStye = NSMutableParagraphStyle()
//    paragraphStye.lineSpacing = 4
//
//    //行间距的范围
//    let distanceRange = NSMakeRange(0, CFStringGetLength(strg as CFString?))
//    attrstring.addAttribute(NSAttributedStringKey.paragraphStyle, value: paragraphStye, range: distanceRange)
//    lab.attributedText = attrstring//赋值方法

//        添加不同字体颜色

//        myMutableString.addAttribute(kCTForegroundColorAttributeName, value:FfontColor, range:NSRange(location:1,length:4))
//
//        //添加不同字体大小
//
//        myMutableString.addAttribute(NSFontAttributeName, value:UIFont.systemFontOfSize(12.0), range:NSRange(location:1,length:4))
//
//        Uname.attributedText= myMutableString
        
        
//        //tableivew顶部有20像素空白
//        if #available(iOS 11.0, *) {
////            myTabV.contentInsetAdjustmentBehavior = .never
//        }
//
//        SwiftBlock.fun1 {
//            print("不带参数也不带返回值")
//        }
//
//        SwiftBlock.fun2 { (str) in
//            print(str)
//        }
//
//        SwiftBlock.fun3(a: 1, b: 2) { (result) in
//            print(result)
//        }
//
//        SwiftBlock.fun3_1 { (a, error) in
//
//        }
//
//        SwiftBlock.fun4(a: 1, b: 2) { (result) -> Int in
//            return result*3
//        }
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

